from random import randint
from typing import *


class Solution:

    def countCompleteSubarrays(self, nums: List[int]) -> int:
        l = 0
        cnt = Counter(nums)
        d = len(cnt)
        s = DefaultDict(int)
        ans = 0
        for i, v in enumerate(nums):
            s[v] += 1
            while l < len(nums) and len(s) == d:
                s[nums[l]] -= 1
                ans += len(nums) - i
                if s[nums[l]] == 0:
                    s.pop(nums[l])
                l += 1
        return ans
    
a = []
for i in range(100):
    a.append(randint(0,100))
print(a)